/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cz.muni.service;

import cz.muni.restinterface.CustomerDTO;
import java.util.List;
import javax.ejb.Local;

/**
 *
 * @author Anton Giertli
 */
@Local
/**
 * Interface for service layer - methods simply call methods of DAO layer
 * Service layer uses Data Transfer Objects - which has exactly the same attributes
 * as their Entity representative.
 */
public interface CustomerServiceLocal {
    
    
    /**
     * Find customers by their first name
     * @param fistName
     * @return List of customers with given first name
     */
    public List<CustomerDTO> findByFirstName(String fistName);
    
    
    /**
     * Find customers by their last name
     * @param lastName
     * @return List of customers with given last name
     */
    public List<CustomerDTO> findByLastName(String lastName);
    
    
    /**
     * Find customers by their email
     * @param email
     * @return List of customers with given email
     */
    public List<CustomerDTO> findByEmail(String email);
    
    
    /**
     * Find customers by their phone number
     * @param number
     * @return List of customers with given phone number
     */
    public List<CustomerDTO> findByPhoneNumber(String number);
    
    /**
     * Create customer (customer is inserted in DB)
     * @param customerDTO 
     */
    public void create(CustomerDTO customerDTO);
    
    /**
     * Remove customer (customer is deleted from DB)
     * @param customer 
     */
    public void delete(CustomerDTO customer);
    
    /**
     * Find customer by ID
     * @param id
     * @return Customer with given ID
     */
    public  CustomerDTO find(Long id);
    
    /**
     * Update customer
     * @param customer
     * @return Updated customer
     */
    public  CustomerDTO update(CustomerDTO customer);
    
    /**
     * Find all customers
     * @return List of all customers
     */
    public List<CustomerDTO> findAll();
    
}
